]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Use logErrorUnlessCancelled() helper
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 22 Oct 2025 01:30:41 +0000 (03:30 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 24 Nov 2025 13:42:59 +0000 (14:42 +0100)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3927>
(cherry picked from commit f1cd8520b7c7f0f9ee2dbb57623bba972f2cfd2c)

js/gdm/util.js
js/misc/ibusManager.js
js/misc/inputMethod.js

index f6b797c32148a64cc920ecf429ff7b04984aae3d..c45579a22b2b3315a826594f5ff6cbca7a00979b 100644 (file)
@@ -8,6 +8,7 @@ import * as Batch from './batch.js';
 import * as OVirt from './oVirt.js';
 import * as Vmware from './vmware.js';
 import * as Main from '../ui/main.js';
+import {logErrorUnlessCancelled} from '../misc/errorUtils.js';
 import {loadInterfaceXML} from '../misc/fileUtils.js';
 import * as Params from '../misc/params.js';
 import * as SmartcardManager from '../misc/smartcardManager.js';
@@ -240,8 +241,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
             await this._handlePendingMessages();
             this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                logError(e);
+            logErrorUnlessCancelled(e);
         }
     }
 
@@ -858,8 +858,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
                 this._retry(serviceName);
             }
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                logError(e);
+            logErrorUnlessCancelled(e);
         }
     }
 
index 9ea9f6bae7be18ecf2fe46753b0d98b2bfed070a..7083e8dd166013dee207f0c7356c7033c2476778 100644 (file)
@@ -6,6 +6,7 @@ import Shell from 'gi://Shell';
 
 import * as Signals from './signals.js';
 import * as BoxPointer from '../ui/boxpointer.js';
+import {logErrorUnlessCancelled} from './errorUtils.js';
 
 import * as IBusCandidatePopup from '../ui/ibusCandidatePopup.js';
 
@@ -172,11 +173,8 @@ class IBusManager extends Signals.EventEmitter {
             }
             this._updateReadiness();
         } catch (e) {
-            if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                return;
-
-            logError(e);
-            this._clear();
+            if (logErrorUnlessCancelled(e))
+                this._clear();
         }
     }
 
@@ -185,10 +183,8 @@ class IBusManager extends Signals.EventEmitter {
             await this._ibus.request_name_async(IBus.SERVICE_PANEL,
                 IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
-                logError(e);
+            if (logErrorUnlessCancelled(e))
                 this._clear();
-            }
             return;
         }
 
@@ -287,8 +283,7 @@ class IBusManager extends Signals.EventEmitter {
                 this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
                 this._cancellable);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                logError(e);
+            logErrorUnlessCancelled(e);
         }
     }
 
index 31592410380694cc6eb30fcbc2aa15b8499e51f9..ee7716628f6403ced09c05ce30f215130e986c44 100644 (file)
@@ -4,6 +4,7 @@ import Gio from 'gi://Gio';
 import GObject from 'gi://GObject';
 import IBus from 'gi://IBus';
 
+import {logErrorUnlessCancelled} from './errorUtils.js';
 import * as Keyboard from '../ui/status/keyboard.js';
 import * as Main from '../ui/main.js';
 
@@ -75,10 +76,8 @@ export const InputMethod = GObject.registerClass({
             this._context = await this._ibus.create_input_context_async(
                 'gnome-shell', -1, this._cancellable);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
-                logError(e);
+            if (logErrorUnlessCancelled(e))
                 this._clear();
-            }
             return;
         }